package com.accp.vehiclecare.dao.hzdao;

import com.accp.vehiclecare.pojo.Enginetype;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface EnginetypeMapper {
    int deleteByPrimaryKey(Integer enginetypeid);

    int insert(Enginetype record);

    int insertSelective(@Param("record") Enginetype record);

    Enginetype selectByPrimaryKey(Integer enginetypeid);

    int updateByPrimaryKeySelective(Enginetype record);

    int updateByPrimaryKey(Enginetype record);

    //查询所有品牌
    @Select("SELECT * FROM `enginetype`")
    List<Enginetype> ShowList();

    //删除选中的品牌
    @Delete("DELETE FROM `enginetype` WHERE `enginetypeid` = #{id}")
    int DeletePP(@Param("id") Integer id);

    //添加品牌
    @Insert("INSERT INTO `enginetype`(`enginetypeid`,`enginetypename`)VALUES(#{Enginetype.enginetypeid},#{Enginetype.enginetypename});")
    int AddPP(@Param("Enginetype")Enginetype enginetype);

    //单个id查询品牌信息
    @Select("SELECT * FROM `enginetype` where enginetypeid=#{id}")
    Enginetype QueryOnePP(@Param("id")Integer id);

    //根据id修改品牌
    @Update("UPDATE enginetype SET enginetypeid = #{enginetype.enginetypeid} , enginetypename = #{enginetype.enginetypename} WHERE enginetypeid = #{id}")
    int update(@Param("enginetype")Enginetype enginetype,@Param("id")Integer id);
}